<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>数据导入</title>
<link href="styles/general.css" rel="stylesheet" type="text/css">
<link href="styles/main.css" rel="stylesheet" type="text/css">

<script type="text/javascript" src="js/utils.js"></script>
<link rel="stylesheet" type="text/css" href="js/jquery/uploadify/uploadify.css"/>
<script type="text/javascript" src="js/jquery/uploadify/jquery.min.js"></script>
<script src="js/jquery/uploadify/jquery.uploadify.js" type="text/javascript"></script>

<script type="text/javascript">
function txcheck(){
	return formvalidator("all");
}
function formvalidator(obj)
{
	var controlId = "all";
	 if (typeof(obj) != "string" )
	 {
		 controlId = obj.id;
	 }
	if(controlId=="all" || controlId=="logmodel.filename")
	{
		if(Utils.trim(document.getElementById("logmodel.filename").value)=="")
		{
			alert("选择导入的文件！");
			return false;
		}
	}
	$("input[type=submit]").val("正在导入。。。").attr("disabled",true);
	return true;
}

</script>
</head>

<body>
<form id="form1" name="form1" method="post" action="importuserdata_view.do" onsubmit="return txcheck();">
 <h1>
        <span class="action-span"></span> <span
            class="action-span1"><a href="">
                首页</a> </span><span id="search_id" class="action-span1">- CPA用户数导入 </span>
        <div style="clear: both">
        </div>
    </h1>
 <div style="margin-bottom: 5px;" class="list-div">
        <table width="100%" cellspacing="1" cellpadding="3">
            <tbody>
                <tr>
                    <th colspan="2">
                        用户数导入
                    </th>
                </tr>
                <tr> 
				    <td  class="label"><div align="right">数据文件：</div></td> 
				    <td>
								<div id="queue"></div>
								<input id="datafile" name="datafile" type="file"/>
							<script type="text/javascript">
								$(function() {
									$('#datafile').uploadify({
										'formData'     : {
											'timestamp' : '321'
										},
										'swf'      : 'js/jquery/uploadify/uploadify.swf',
										'uploader' : 'importuserdata_uploaddatafile.do',
										'buttonText' : '选择数据文件...',
										'fileSizeLimit' : '100MB',
										'fileTypeDesc' : 'Xls Files',
								        'fileTypeExts' : '*.xls',
										'onUploadSuccess' : function(file, data, response) {
											var div = document.getElementById("datafilediv");
											div.innerHTML=data;
									    }
									    ,
									    'cancel':'false'
									});
								});
							</script>
                            <div id="datafilediv">
                            	<s:property value="logmodel.filename"/>
                            	<input type="hidden" id="logmodel.filename" name="logmodel.filename" value="<s:property value="logmodel.filename"/>"/>
                            	<input type="hidden" id="logmodel.refilename" name="logmodel.refilename" value="<s:property value="logmodel.refilename"/>"/>
                            	<input type="hidden" id="logmodel.filesrc" name="logmodel.filesrc" value="<s:property value="logmodel.filesrc"/>"/>
                            </div>
                            <font color="red"><s:actionerror/></font>
                    </td>
				  </tr>		 
				  <tr>
                    <td colspan="2" align="center">
                     <s:if test="isUpdate.equals('true')">
					    <input type="submit" value=" 确定 " class="button" />
					 </s:if>
                        &nbsp;&nbsp;&nbsp;
                        <input type="reset" value=" 重置 " class="button" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center">
                    	<a target="_" href="datatemplate/userdatatemplate.xls">下载数据模版</a>
                	</td>
               	</tr>
	 	</tbody>
	 </table>
 </div>
</form>
 <!--Bottom开始-->
    
<div id="footer">
<br />
<s:property value="bottom"/></div>
    <!--Bottom结束-->
  
</body>
</html>